//
//  SystemSettingTableViewCell.m
//  Router
//
//  Created by teki on 15/10/14.
//  Copyright © 2015年 dc. All rights reserved.
//

#import "SystemSettingTableViewCell.h"


@interface SystemSettingTableViewCell ()
@property (weak, nonatomic) IBOutlet UIImageView *mImageView;
@property (weak, nonatomic) IBOutlet UILabel *mLabel;

@end

@implementation SystemSettingTableViewCell

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self)
    {
        // 初始化时加载Cell.xib文件
        NSArray *arrayOfViews = [[NSBundle mainBundle] loadNibNamed:NSStringFromClass([self class]) owner:self options:nil];
        
        // 如果路径不存在，return nil
        if (arrayOfViews.count < 1)
        {
            return nil;
        }
        // 如果xib中view不属于UITableViewCell类，return nil
        if (![[arrayOfViews objectAtIndex:0] isKindOfClass:[UITableViewCell class]])
        {
            return nil;
        }
        // 加载nib
        self = [arrayOfViews objectAtIndex:0];
    }
    return self;
}


- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}



- (void)congfigCellWith:(id)object andIndexPath:(NSIndexPath *)indexPath
{
    self.mLabel.textColor = NavgationBarBackgroundColor;
    if (indexPath.row == 0)
    {
        self.mImageView.image = [UIImage imageNamed:@"settings_unblind"];
        self.mLabel.text = @"解除绑定";
    }else if (indexPath.row == 1){
        self.mImageView.image = [UIImage imageNamed:@"settings_restart"];
        self.mLabel.text = @"重启WIFI";
    }else if(indexPath.row == 2){
        self.mImageView.image = [UIImage imageNamed:@"settings_about"];
        self.mLabel.text = @"关于小叶WIFI";
    }else{
        self.mImageView.image = [UIImage imageNamed:@"settings_up"];
        self.mLabel.text = @"升级固件";
    }
    
}




- (void)configMyViewCellWith:(id)object andIndexPath:(NSIndexPath *)indexPath
{
    self.mLabel.textColor = SeparatorLineColor;
    if (indexPath.row == 0)
    {
        self.mImageView.image = [UIImage imageNamed:@"my_wifi"];
        self.mLabel.text = @"我的小叶WIFI";
    }else if (indexPath.row == 1){
        self.mImageView.image = [UIImage imageNamed:@"my_name"];
        self.mLabel.text = @"设置昵称";
    }else{
        self.mImageView.image = [UIImage imageNamed:@"my_password"];
        self.mLabel.text = @"修改密码";
    }
}

@end
